#include <iostream>
#include "Protocol.hpp"

int main()
{
    Request request(10,'+',20);
    std::string s1;
    request.Serialize(s1);
    std::cout<<"序列化"<<std::endl;
    std::cout<<s1<<std::endl;
    if(Encode(s1))
    {
        std::cout<<"Encode"<<std::endl;
        std::cout<<s1<<std::endl;
    }
    //解码
    std::string content;
    if(Decode(s1,&content))
    {
        std::cout<<"Decode:"<<std::endl;
        std::cout<<content<<std::endl;
    }
    request.Deserialize(content);
    request.Print();
    return 0;
}